package io.renren.modules.shop.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 订单表
 */
@ApiModel(value = "io-renren-modules-shop-entity-GoodsOrder")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "goods_order")
public class GoodsOrder {
    /**
     * 订单id
     */
    @TableId(value = "order_id", type = IdType.AUTO)
    @ApiModelProperty(value = "订单id")
    private Integer orderId;

    /**
     * 订单总价
     */
    @TableField(value = "order_all_price")
    @ApiModelProperty(value = "订单总价")
    private BigDecimal orderAllPrice;

    /**
     * 优惠价格
     */
    @TableField(value = "order_bargain_price")
    @ApiModelProperty(value = "优惠价格")
    private BigDecimal orderBargainPrice;

    /**
     * 优惠后价格
     */
    @TableField(value = "order_end_price")
    @ApiModelProperty(value = "优惠后价格")
    private BigDecimal orderEndPrice;

    /**
     * 订单表状态 -1为已失效，0为加入购物车，1为待付款，2为付款成功，3为已收货
     */
    @TableField(value = "order_status")
    @ApiModelProperty(value = "订单表状态 -1为已失效，0为加入购物车，1为待付款，2为付款成功，3为已收货 ")
    private Integer orderStatus;

    /**
     * 创建人
     */
    @TableField(value = "openid")
    @ApiModelProperty(value = "创建人")
    private String openid;

    /**
     * 优惠券id
     */
    @TableField(value = "coupon_id")
    @ApiModelProperty(value = "优惠券id")
    private Integer couponId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    /**
     * 付款时间
     */
    @TableField(value = "pay_time")
    @ApiModelProperty(value = "付款时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date payTime;

    /**
     * 订单内具体货物
     */
    @TableField(exist = false)
    private List<GoodsMsg> list;
}
